import { Pipe } from '@angular/core';

import _ from 'lodash';

import { conf } from '../config';

@Pipe({ name: 'eventKind' })
export class EventKindPipe {
  transform(kind) {
    if (kind == 1) {
      return 'Summit';
    } else if (kind == 2) {
      return 'Workshop';
    } else {
      return 'Others';
    }
  }
}

@Pipe({ name: 'ftImage' })
export class ImagePipe {
  transform(img_id) {
    let file = _.split(img_id, ',', 1);
    if(file.length == 0) {
      return;
    } else {
      return conf.qn_bkt + file[0];
    }
  }
}
